﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Trade.Controls;
using Trade.DAL;
using Trade.Model;

namespace Trade
{
    public partial class FrmPurchaseSearchCondition : Trade.Controls.RayForm
    {
        FrmPurchaseMain purchaseMainForm = null;

        public FrmPurchaseSearchCondition()
        {
            InitializeComponent();
        }

        private void FrmPurchaseSearchCondition_Load(object sender, EventArgs e)
        {
            purchaseMainForm = (FrmPurchaseMain)this.Owner;
        }

        private void btnApply_Click(object sender, EventArgs e)
        {
            purchaseMainForm.condPurchaseNo = txtPurchaseNo.Text.Trim();
            purchaseMainForm.condReferenceNo = txtReferenceNo.Text.Trim();
            purchaseMainForm.condVendor = txtVendor.Text.Trim();
            purchaseMainForm.condWarehouse = txtWarehouse.Text.Trim();
            purchaseMainForm.condBuyer = txtBuyer.Text.Trim();
            purchaseMainForm.condEntryDate = txtEntryDate.Text.Trim();
            purchaseMainForm.condStatus = (cmbStatus.SelectedIndex == 1 ? true : false);
            purchaseMainForm.condApply = true;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
